﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Function Wildcard</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    
    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
    $(document).ready(function () {
        var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 1 });
        initSpread(spread);
    });
    function initSpread(spread) {
        var spreadNS = GcSpread.Sheets;
        var sheet = spread.sheets[0];

        spread.isPaintSuspended(true);
        sheet.allowCellOverflow(true);

        var array = [
            ["Tree", "Height", "Age", "Yield", "Profit", "Height"],
            ["=App?e", ">10", null, null, null, "<16"],
            ["=P*"],
            ["Tree", "Height", "Age", "Yield", "Profit"],
            ["Apple", 18, 20, 14, 105],
            ["Pear", 12, 12, 10, 96],
            ["Cherry", 13, 14, 9, 105],
            ["AppLe", 14, 15, 10, 75],
            ["Pear", 9, 8, 8, 76.8],
            ["Apple", 8, 9, 6, 45]
        ];
        sheet.setArray(0, 0, array);

        var table = sheet.addTable("Table1", 0, 0, 3, 6, spreadNS.TableStyles.medium9());
        table.rowFilter().setShowFilterButton(false);

        table = sheet.addTable("Table2", 3, 0, 7, 5, spreadNS.TableStyles.medium9());
        table.rowFilter().setShowFilterButton(false);

        table = sheet.addTable("Table3", 11, 0, 5, 6, spreadNS.TableStyles.medium9());
        table.rowFilter().setShowFilterButton(false);
        sheet.addSpan(11, 1, 1, 5);
        sheet.setValue(11, 0, 'Value');
        sheet.setValue(11, 1, 'Formula with wildcard');

        sheet.addSpan(12, 1, 1, 5);
        sheet.setValue(12, 1, '=DCOUNT(A4:E10,"Age",A1:F3)');
        sheet.setFormula(12, 0, 'DCOUNT(A4:E10,"Age",A1:F3)');

        sheet.addSpan(13, 1, 1, 5);
        sheet.setValue(13, 1, '=SEARCH("?t", B1)');
        sheet.setFormula(13, 0, 'SEARCH("?t", B1)');

        sheet.addSpan(14, 1, 1, 5);
        sheet.setValue(14, 1, '=VLOOKUP("Ch*",A5:B10,2,0)');
        sheet.setFormula(14, 0, 'VLOOKUP("Ch*",A5:B10,2,0)');

        sheet.addSpan(15, 1, 1, 5);
        sheet.setValue(15, 1, '=COUNTIF(A5:B11,"App?e")');
        sheet.setFormula(15, 0, 'COUNTIF(A5:B11,"App?e")');

        sheet.setValue(16, 1, '=SEARCH("=P~*",A3)');
        sheet.setFormula(16, 0, 'SEARCH("=P~*",A3)');

        spread.isPaintSuspended(false);
    };
    /*code_end*/
    </script>
</head>
<body>
    <div class="sample-turtorial">
        <div id="ss" style="width:100%; height:460px;border: 1px solid gray;"></div>
    </div>
</body>
</html>